package com.cn.wanxi.servlet;

import com.cn.wanxi.service.CompanyService;
import com.cn.wanxi.service.NavService;

import javax.servlet.http.HttpServletRequest;

class CommonServlet {
//    修饰符 默认不写的范围  同包
//    static 静态资源  如果用static修饰后，则代表在内存里面只创建一次
    static void getCommonData(HttpServletRequest req) {
        CompanyService companyService = new CompanyService();
        req.setAttribute("companyModel", companyService.getCompanyModel());

        NavService navService = new NavService();
        req.setAttribute("navModels", navService.getNavModels());
    }
}
